/********************
 *	系统全局配置信息
 ********************/
define(function(require){
	var win = window;
	var host = win.location.host;
	var ROOT = win.ROOT;
	var USER = win.APP_USERDATA;
	var SITE = USER && USER.site;
	var SITEBASE = win.APP_SITEBASE || '';
	var $ = require('jquery');
	var util = require('util');
	var dspUtil = require('dspUtil');

	var info = window.APP_THEME || {};

	var report_menu = [ // 基础菜单
			{text:_T("计划"), alias:_T("计划"), link: "#plan", navRight: "admin.plan", addName:'Plan', icon:'icon-plan'},
			{text:_T("活动"), alias:_T("活动"), link: "#campaign", navRight: "admin.campaign", addName:'Campaign', icon:'icon-campaign'},
			{text:_T("创意包"), alias:_T("创意包"), link: "#sweety", navRight: "admin.sweety", addName:'Sweety', icon:'icon-sweety'},
			{text:_T("落地页"), alias:_T("落地页"), link: "#whisky", navRight: "admin.whisky", addName:'Whisky', icon:'icon-whisky'},
			{text:_T("广告位"), alias:_T("广告位"), link: "#ads", navRight: "admin.spot", icon:'icon-ads'},
			{text:_T("产品"), alias:_T("产品"), link: "#product", navRight: "admin.product", icon:'icon-product'},
			{text:_T("组合维度"), alias:_T("组合"), link: "#mixDimension", navRight: "admin.groupDim", icon:'icon-mixDimension'},
			{text:_T("汇总"), alias:_T("汇总"), link: "#overview", navRight: "administrator.overview", icon:'icon-overview'}
		];

	var admin_menu = [
		{text:_T("管理中心"), alias:_T("管理"), icon:'icon-tools', items:[
				{text:_T("客户管理"), alias:_T("客户"), link: "#admin/customer", navRight: 'agent.user'},
				{text:_T("财务申请"), alias:_T("财务"), link: "#admin/financeAudit", navRight: 'administrator.financeAudit'},
				{text:_T("发票管理"), alias:_T("发票"), link: "#admin/invoiceManage", navRight: 'invoice.audit'},
				{text:_T("资质管理"), alias:_T("资质"), link: "#admin/aptitude", navRight: 'agent.qualification'},
				{text:_T("公告管理"), alias:_T("公告"), link: "#admin/messageManage", navRight: 'administrator.message'},
				{text:_T("操作日志"), alias:_T("日志"), link: "#admin/log", navRight: "admin.operationLog"},
				{text:_T("资源监控报表"), alias:_T("监控"), link: "#resourceReport", navRight:"administrator.resourceMonitor"},
				{text:_T("帮助中心"), alias:_T("帮助"), link: "#admin/help", navRight: "administrator.help"},
				{text:_T("自查帮助文档"), alias:_T("自查"), link: "#admin/guide", navRight: "admin.guide"},
				{text:_T("API设置"), alias:_T("API"), link: "#admin/apiManage", navRight: "administrator.gameApi"},
				{text:_T("订单管理"), alias:_T("订单"), link: "#admin/deal", navRight: 'administrator.deal'},
				{text:_T("资源权限设置"), alias:_T("权限"), link: "#admin/userAccess", navRight: "administrator.userAccess"},
				{text:_T("全局策略"), alias:_T("策略"), link: "#admin/strategy", navRight: "advance.strategy"},
				{text:_T("自定义下载"), alias:_T("自定义"), link: "#admin/customDownload", navRight: "admin.customDownload"}
				//{text:_T("离线下载列表"), alias:_T("离线"), link: "#admin/offline", navRight: "admin.export"}
			]
		},
		{text:_T("用户中心"), alias:_T("用户"), icon:'icon-user', items:[
				{text:_T("财务中心"), alias:_T("财务"), link: "#user/financeCenter", navRight: 'admin.bill'},
				{text:_T("发票管理"), alias:_T("发票"), link: "#user/invoiceDetail", navRight: "admin.invoice"},
				{text:_T("消息公告"), alias:_T("消息"), link: "#user/message", navRight: "admin.usermessage"},
				{text:_T("代码中心"), alias:_T("代码"), link: "#user/codeCenter"},
				//{text:_T("运营日志"), link: "#user/runninglog", navRight: "admin.operationRemark"},
				{text:_T("帮助中心"), alias:_T("帮助"), link: "#user/help", navRight: "admin.help"},
				{text:_T("监控消息"), alias:_T("监控"), link: "#user/messageMonitor", navRight: "monitor.noticeList"},
				{text:_T("智能监控"), alias:_T("智能"), link: "#user/smartMonitor", navRight: "monitor.listAlarms"},
				{text:_T("人群标签"), alias:_T("人群"), link: "#user/peopleTag"}
			]
		}
	];

	// 简单版report
	var report_menu_lite = [
		{text:_T("活动"), alias:_T("活动"), link: "#campaignLite", navRight: "admin.campaign", icon:'icon-campaign'},
		{text:_T("创意包"), alias:_T("创意包"), link: "#sweetyLite", navRight: "admin.sweety", icon:'icon-whisky'},
		{text:_T("组合维度"), alias:_T("组合"), link: "#mixDimensionLite", navRight: "admin.groupDim", icon:'icon-mixDimension'}
	];
	// 简单版admin
	var admin_menu_lite = [
		{text:_T("用户中心"), alias:_T("用户"), icon:'icon-user', items:[
				{text:_T("财务中心"), alias:_T("财务"), link: "#user/financeCenter"},
				{text:_T("发票管理"), alias:_T("发票"), link: "#user/invoiceDetail"},
				{text:_T("消息公告"), alias:_T("消息"), link: "#user/message"},
				{text:_T("代码中心"), alias:_T("代码"), link: "#user/codeCenter"},
				{text:_T("帮助中心"), alias:_T("帮助"), link: "#user/help"}
			]
		}
	];

	// 简单版admin
	var video_type = 'wmv,avi,dat,asf,rm,rmvb,ram,mpg,mpeg,3gp,mov,mp4,m4v,dvix,dv,dat,mkv,vob,ram,qt,divx,cpk,fli,flc,mod';

	return {
		// 调试模式
		debug: 2,
		// 默认路由入口
		router: {
			default_module: 'home',
			default_action: 'main',
			login_module: 'login',
			login_action: 'main',
			no_right: 'noright',
			publics: ['login', 'privacy']
		},
		// 系统名称
		app_title: info.title,
		// 系统CopyRight
		app_footer: info.copyright,
		// 系统Logo
		app_logo: {
			title: info.title,
			small: ROOT(info.logo || ''),
			big: ROOT(info.big_logo || ''),
			smaller: ROOT(info.small_logo || "resources/images/logo_smaller.png")
		},
		// 系统CopyRight
		app_copyright: info.copyright,
		// 是否显示隐私控制
		app_show_privacy: +info.show_privacy || '',
		// 代码中心独立PDMP数据采集域名
		app_custom_domain: info.custom_domain || '',
		// 代码中心基础统计代码
		app_custom_domainA: info.custom_domainA || '',
		// 代码中心1像素图片／Flash版PDMP代码收集
		app_custom_domainB: info.custom_domainB || '',
		// 代码中心1像素图片统计注册
		app_custom_domain1px: info.custom_domain1px || '',
		// 登陆url
		loginUrl: '',
		// 登陆cookie信息
		login: {
			cookie_expires: 30, // 保存30天
			user_cookie_name: 'bx_user_cookie',
			user_sessionId: 'sessionId',
			user_rememberId: 'rememberId'
		},
		login_title: _T('用户登陆'),
		app: {
			isDebug: false,
			mc: {
				"uri_prefix": "/DSP/",	//普通用户
				"prefix": {
					"/": "default://",
					"/test/": "test://"
				},
				"remotes": {
					"default": {
						"type": "websocket",
						"path": '/api/dsp/ws_add',
						// "transports": ['websocket', 'polling'],
						"transports": ['websocket'],
						"url": "http://"+host
					},
					"local": {
						"type": "local"
					},
					// 静态测试文件
					"test": {
						"type": "file",
						"base": "/data/test/" // 静态测试文件存储路径
					}
				}
			},
			// 表格对比
			subgrid: {
				// 汇总渠道
				'amount_channel': {
					'modules': {
						'uri': 'subgrid/amount.channel',
						'config': {
							'url': 'campaign/amountSubgrid',
							'gridName': 'campaign_amountSubgrid',
							'gridNameSuffix': '_channel',
							'subName': 'amount_channel',
							'hasDateRange': true,
							'syncParentGridParam': true
						}
					}
				},
				// 汇总时段
				'amount_period': {
					'modules': {
						'uri': 'modules/chart.period',
						//'uri': 'subgrid/amount.period',
						'config': {
							'url': 'campaign/amountSubgrid',
							'gridName': 'campaign_amountSubgrid',
							'gridNameSuffix': '_period',
							'subName': 'amount_period',
							'syncParentGridParam': true,
							'gridParam': {
								'Type': 'period'
							}
						},
						'param': {
							'Type': 'period'
						}
					}
				},
				// 汇总地区
				'amount_region': {
					'modules': {
						'uri': 'subgrid/region.base',
						'config': {
							'url': 'campaign/amountSubgrid',
							'gridName': 'campaign_amountSubgrid',
							'gridNameSuffix': '_region',
							'subName': 'amount_region',
							'syncParentGridParam': true
						},
						'param': {
							'Type': 'region'
						}
					}
				},
				// 媒体&广告位 -选项卡
				'mediaAndAd': {
					'modules': {
						'uri': 'subgrid/mediaAndAd.base',
						'config': {
							'isRTB': true,
							'subName': 'mediaAndAd'
						}
					}
				},
				// 媒体&广告位 -监测活动 -选项卡
				'mediaAndAd_Monitor': {
					'modules': {
						'uri': 'subgrid/mediaAndAd.base',
						'config': {
							'isRTB': false,
							'subName': 'mediaAndAd_Monitor'
						}
					}
				},
				// 媒体&广告位
				'mediaAndAd_lite': {
					'modules': {
						'uri': 'subgrid/mediaAndAd.lite',
						'config': {
							'isRTB': true,
							'subName': 'mediaAndAd_lite'
						}
					}
				},
				// 创意包
				'sweety': {
					'title': _T('创意包'),
					'modules': {
						'uri': 'sweety/grid/sweety.subSweetyGrid',
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'sweety',
							'hasDateRange': true,
							'syncDateParam': true
						}
					}
				},
				// 落地页
				'whisky': {
					'title': _T('落地页'),
					'modules': {
						'uri': 'whisky/grid/whisky.base',
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'whisky',
							'hasDateRange': true,
							'syncDateParam': true
						}
					}
				},
				// 时段分析 -图表
				'period': {
					'modules': {
						'uri': 'modules/chart.period',
						'config': {
							'subName': 'period'
						}
					}
				},
				// 频次对比 -图表
				'frequency': {
					'modules': {
						'uri': 'modules/chart.frequency',
						'config': {
							'subName': 'frequency'
						}
					}
				},
				// 地域 -图表
				'region': {
					'modules': {
						'uri': 'subgrid/region.base',
						'config': {
							'subName': 'region'
						}
					}
				},
				// 客户端 -选项卡
				'client': {
					'modules': {
						'uri': 'subgrid/client.base',
						'config': {
							'subName': 'client'
						}
					}
				},
				// 产品 -选项卡
				'product': {
					'modules': {
						'uri': 'subgrid/product.base',
						'config': {
							'subName': 'product'
						}
					}
				},
				// 活动
				'campaign': {
					'title': _T('活动'),
					'modules': {
						'uri': 'campaign/grid/campaign.subGrid',
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'campaign',
							'hasDateRange': true,
							'syncDateParam': true
						}
					}
				},
				// 创意
				'creative': {
					'title': _T('创意'),
					'modules': {
						'uri': 'subgrid/creative.base',
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'creative',
							'hasDateRange': true,
							'syncDateParam': true
						}
					}
				},
				'channelCategory': {
					'title': _T('频道分类'),
					'modules': {
						'uri': 'subgrid/channelCategory.base',
						'config': {
							'subName': 'channelCategory'
						}
					}
				},
				'channelCategory2': {
					'title': _T('二级频道分类'),
					'modules': {
						'uri': 'subgrid/channelCategory.base2',
						'config': {
							'subName': 'channelCategory2'
						}
					}
				},
				// 汇总地区
				'amount_channelCategory': {
					'modules': {
						'uri': 'subgrid/channelCategory.amount',
						'config': {
							'subName': 'amount_channelCategory',
							// 'syncParentGridParam': true
						},
						'param': {

						}
					}
				},
				// 直客列表
				'admin_direct': {
					'modules': {
						// 'uri': 'admin/customer/grid/customer.base',
						'uri': 'admin/customer/action/list.main',
						'config': {
							'isSubGrid': true,
							'hasSearch': true,
							'subs': ['admin_cost'],
							'class': 'P-dspUser',
							'hasHead': false,
							'grid_config': {
								'hasFilter': false
							},
							'subName': 'admin_direct',
							'uuid': util.uuid()
						}
					}
				},
				//todo  客户报表的子表格消费明细报表
				'admin_cost': {
					'modules': {
						'uri': 'admin/customer/grid/costGrid.base',
						'config': {
							'hasAmount': false,
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'admin_cost'
						}
					}
				},
				// 汇总订单客户列表
				'deal_customer': {
					'modules': {
						'title': _T('客户报表'),
						'uri': 'admin/customer/grid/dealCustomer.base',
						// 'uri': 'admin/customer/action/list.main',
						'config': {
							'class': 'M-HighGrid P-dspUser',
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'deal_customer',
							'syncDateParam': true,
							'hasDateRange': true,
							'userStorageDate': false,
							'dateRange': {
								'userStorage': false
							}
						}
					}
				},
				// 汇总广告位客户子表格
				'spot_customer': {
					'modules': {
						'title': _T('客户报表'),
						'uri': 'admin/customer/grid/customer.spot',
						'config': {
							'class': 'M-HighGrid P-dspUser',
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'spot_customer',
							'syncDateParam': true,
							'hasDateRange': true,
							'userStorageDate': false,
							'dateRange': {
								'userStorage': false
							}
						}
					}
				},
				// 落地页
				'overview_whisky': {
					'title': _T('落地页'),
					'modules': {
						'uri': 'whisky/grid/whisky.base',
						'param':{
							'get_all_info': 1,
							'ListAll':1,
							'showChildren':1,
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_whisky',
							'syncDateParam': true,
							'hasDateRange': true,
							'userStorageDate': false,
							'dateRange': {
								'userStorage': false
							}
						}
					}
				},
				// 产品 -选项卡
				'overview_product': {
					'modules': {
						'uri': 'subgrid/product.base',
						'param':{
							'get_all_info': 1,
							'ListAll':1,
							'showChildren':1,
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_product',
							'uuid': util.uuid()
						}
					}
				},
				// 活动
				'overview_campaign': {
					'title': _T('活动'),
					'modules': {
						'uri': 'campaign/grid/campaign.subBase',
						'param':{
							'get_all_info': 1,
							'ListAll':1,
							'showChildren':1,
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_campaign',
							'syncDateParam': true,
							'hasDateRange': true,
							'userStorageDate': false,
							'dateRange': {
								'userStorage': false
							}
						}
					}
				},
				// 创意
				'overview_creative': {
					'title': _T('创意'),
					'modules': {
						'uri': 'subgrid/creative.base',
						'param':{
							'get_all_info': 1,
							'ListAll':1,
							'showChildren':1,
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_creative',
							'syncDateParam': true,
							'hasDateRange': true,
							'userStorageDate': false,
							'dateRange': {
								'userStorage': false
							}
						}
					}
				},
				// 时段 -图表
				'overview_period': {
					'modules': {
						'uri': 'modules/chart.period',
						'param':{
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_period'
						}
					}
				},
				// 频次对比
				'overview_frequency': {
					'modules': {
						'uri': 'modules/chart.frequency',
						'param':{
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_frequency'
						}
					}
				},
				// 地域
				'overview_region': {
					'modules': {
						'uri': 'subgrid/region.base',
						'param':{
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_region'
						}
					}
				},
				// 客户端 -选项卡
				'overview_client': {
					'modules': {
						'uri': 'subgrid/client.base',
						'param':{
							'get_all_info': 1,
							'ListAll':1,
							'showChildren':1,
							'overview_subgrid':1
						},
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'overview_client',
							'uuid': util.uuid()
						}
					}
				},
				// 对比创意包
				'compare_sweety': {
					'title': _T('创意包'),
					'modules': {
						'uri': 'subgrid/compare/main.sweety',
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'compare_sweety',
							'hasDateRange': true,
							'syncDateParam': true
						}
					}
				},
				// 对比落地页
				'compare_whisky': {
					'title': _T('落地页'),
					'modules': {
						'uri': 'subgrid/compare/main.whisky',
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'compare_whisky',
							'hasDateRange': true,
							'syncDateParam': true
						}
					}
				},
				// 对比广告位
				'compare_spot': {
					'title': _T('广告位'),
					'modules': {
						'uri': 'subgrid/compare/main.spot',
						'config': {
							'hasSearch': false,
							'hasFilter': false,
							'subName': 'compare_spot',
							'hasDateRange': true,
							'syncDateParam': true
						}
					}
				},
				// 对比时段分析
				'compare_period': {
					'modules': {
						'uri': 'subgrid/compare/period.period',
						'config': {
							'subName': 'compare_period',
							'gridParam': {
							}
						}
					}
				},
				'people': {
					'modules': {
						'uri': 'subgrid/people.main'
					}
				}
			}
		},
		// 子表格参数
		subgrid_field: {
			'plan': 'plan_id',	// 计划
			'campaign': 'campaign_id',	// 活动
			'sweety': 'package_id',		// 创意包
			'whisky': 'whisky_id',		// 落地页
			'product': 'product_id',	// 产品
			'platform': 'platform_id',	// 平台
			'creative': 'creative_id',	// 创意
			'channel': 'channel_id',	// 渠道

			'spot': 'spot_id',				// 广告位
			'domain': 'referer_domain_id',	// 媒体域名
			'spotChannel': 'channel_id',	// 渠道
			'media': 'media_id',			// 媒体
			'spotSize': 'spot_size_id',			// 尺寸
			'spotScreen': 'spot_screen_id',		// 屏次
			'user': 'user_id',		//用户
			// 'spotChannel': 'spot_channel_id',	// 渠道

			/* 时段子表格 */
			"hour": "hour",
			"date": "date",
			"week": "week",
			"month": "month",

			'compare_sweety': 'package_id',	// 对比创意包
			'compare_whisky': 'whisky_id',	// 对比落地页
			'compare_spot': 'spot_id',	// 对比广告位
		},
		// 子表格第一层options
		subgrid_options: [
			{'id': 'plan', 'name': _T('计划')},
			{'id': 'campaign', 'name': _T('活动')},
			{'id': 'sweety', 'name': _T('创意包')},
			{'id': 'whisky', 'name': _T('落地页')},
			{'id': 'spot', 'name': _T('广告位')},
			{'id': 'media', 'name': _T('媒体')},
			{'id': 'size', 'name': _T('尺寸')},
			{'id': 'product', 'name': _T('产品')},
			{'id': 'productPlatform', 'name': _T('平台')},
			{'id': 'mixDimension', 'name': _T('组合维度')},

			{'id': 'overview_channel', 'name': _T('渠道汇总')},
			{'id': 'overview_customer', 'name': _T('客户汇总')},
			{'id': 'overview_campaign', 'name': _T('活动汇总')},
			{'id': 'overview_ads', 'name': _T('广告位汇总')},
			{'id': 'overview_deal', 'name': _T('订单汇总')},

			{'id': 'period', 'name': _T('时段分析')},
			{'id': 'user', 'name': _T('客户列表')}
		],
		// 全局站点ID
		site_id: SITE && SITE.id || 0,
		// 站点首目录
		site_base: SITEBASE,
		// 站点地址格式化字符串
		site_url: SITEBASE + '%1/',
		// 自动登录用户数据
		user_data: USER,
		// 控制器所在目录
		app_base: ROOT('controller/'),
		// 中间件基础目录
		plugin_base: 'plugins/',
		// 模板文件基础路径
		template_base: ROOT('tpl/'),
		// 预览文件地址
		preview_url: ROOT('preview.html?id={1}&type={2}'),
		// 图片缩略工具地址
		thumb_script: "{1}&h={2}&w={3}",
		dateType: '',
		PLATFORM: {
			modules: [
				// platform头部(Head)
				{name:'header', uri:'layout/header.base', target: 'head', config: {
					modules: [
						// 用户工具栏模块(Head)
						{name:'toolbar', uri:'layout/userToolbar.base', target: 'toolbar', config: {}},
						{name:'account', uri:'layout/account.base', target: 'account', config: {}},
						// 语言切换模块(Head)
						{name:'language', uri:'layout/language.base', target: 'language', config:{
							'list':[
								{"name":_T("简体中文"), "icon":'M-languageCN', "type":"zhCN"},
								{"name":_T("繁体(香港)"), "icon":'M-languageHK', "type":"zhHK"},
								{"name":_T("繁体(台湾)"), "icon":'M-languageTW', "type":"zhTW"},
								{"name":_T("English"), "icon":'M-languageEN', "type":"enUS"}
							]
						}},
						// 消息公告(Head)
						{name:'message', uri:'layout/message.base', target: 'message', config: {}},
						// 智能监控消息(Head)
						{name:'monitor', uri:'layout/message.monitor', target: 'monitor', config: {}},
						// 问题(Head)
						{name:'question', uri:'layout/question.base', target: 'question', config: {
							'list':[
								{"name":_T("常见问题"), "uri":"#user/help", "target":'_blank'},
								{"name":_T("代码中心"), "uri":"#user/codeCenter", "target":'_blank'},
								{"name":_T("快捷设置"), "uri":"#admin/shortCut", "target":'_blank'},
								{"name":_T("切换语言"), "uri":"javascript:void(0);", "items":[
										{"name":_T("简体中文"), "type":"zhCN"},
										{"name":_T("繁体(香港)"), "type":"zhHK"},
										{"name":_T("繁体(台湾)"), "type":"zhTW"},
										{"name":_T("English"), "type":"enUS"}
									]
								},
								{"name":_T("财务中心"), "uri":"#user/financeCenter", "target":'_blank'},
								{"name":_T("问题反馈"), "uri":"#feedback", right: 'feedback.add'},
								{"name":_T("退出登录"), "uri":"#login/logout"}
							]
						}},
						// 切换产品(head)
						{name:'switchProduct', uri:'layout/switchProduct.base', target: 'switchProduct', config: {}}
					]
				}},
				// 菜单logo模块
				{name:'logo', uri:'layout/logo.base', target: 'logo'},

				// 菜单模块
				{name:'menu', uri:'layout/nav.base', target: 'menuList'},

				// 报表与后台切换
				{name:'switch', uri:'layout/switch.base', target: 'switch', config: {}},

				// 弹出表格模块
				// {name: 'pop_grid', uri: '@layout/v1/popGrid.base', target: 'SCENES_POPGRID'},

				// 弹出表格模块
				{name: 'pop', uri: '@layout/v1/popbar.base', target: 'SCENES_POP', config: {
					'crumb': {
						'modName': 'crumb',
						'uri': 'modules/crumb.crumb',
						'config': {}
					}
				}}
			]
		},
		app_user_toolbar: [
			// {text:_T("个人信息"), link: "#user/account"},
			// {text:_T("修改密码"), link:"#user/password"}
		],

		// 数据中心参数配置
		data:{
			max_query: 10,
			points: {
				'/tpl':	ROOT('tpl/'),
				'/i18n': ROOT('i18n/'),

				// 登陆
				'/login': '/login',
				'/logout': '/logout'
			}
		},

		// 多语言配置
		language:{
			'default': 'zhCN',
			'cookie': 'lang',
			'style': ROOT('i18n/')
		},

		exchange: null,
		allExchange: null,
		channelMap: null,
		pcChannel: null,
		mobileChannel: null,
		//needAptitudes: [10002, 10009, 10010, 10025, 10028, 10004, 10040, 10048, 10013, 10055, 10056, 10049, 10061, 10057, 10058],
		deal_need_set_spot: [],
		// 默认图片
		default_img: {
			'default': ROOT('resources/images/default.png'),
			'product': ROOT('resources/images/default.png'),
			'sweety': ROOT('resources/images/default.png'),
			'package': ROOT('resources/images/default.png'),
			'creative': ROOT('resources/images/default.png'),
			'whisky': ROOT('resources/images/default.png')
		},
		aptitude_group: null, // 添加资质需要审核的渠道

		//渠道白名单
		'exchange_group': {
			// 保存需要检查广告分类的渠道
			ad_class: [],
			// 保存需要检查敏感词分类的渠道
			//sens_class: [10014],
			sens_class: [],
			baichuan_class: [10062,10064], // 百川类渠道ID
			tanx: [10004,10023], // tanx类渠道ID
			baidu: [10009], // 百度类渠道
			baidu_ad: [10009,10024], // 百度类渠道需要行业分类
			yigao: [10014], // 亿告类渠道
			tencent: [10002], // 腾讯类渠道, 有广告分类
			video_class: [10002, 10020], // 广告位有视频分类渠道
			youku: [10008, 10022, 10060], // 优酷类渠道
			youkuMoblie: [10008], // 优酷移动
			google: [10007, 10026], // 谷歌类渠道
			mongo: [10016, 10026], // 芒果类渠道
			appFlood: [10027], // 木瓜移动类渠道
			valueMaker: [10029], // 万流客渠道
			huzhong: [10028], // 互众渠道
			sohu: [10025], // 搜狐渠道
			chuanyang: [10030], // 传漾渠道
			haiyun: [10031], // 海云渠道
			juxiao: [10033, 10044], // 聚效和聚效移动
			dm: [10035], // 地幔
			xunfei: [10051], // 讯飞移动
			mopub: [10093], // mopub
			yi: [10015, 10017, 10018, 10019, 10021], // 易传媒类渠道
			no_domain: [10001,10002,10003,10005], // 活动诊断没有域名维度的渠道
			app_class: [10024, 10027, 10033, 10043], // 有app分类渠道，格式和mogo app分类不同
			channel_class: [10025], //有频道分类渠道
			deal_media_class: [10008, 10060],
			deal_video_class: [10002],
			bdx_media_class: [],
			campaign_industry: [],
			campaign_sensitive: [],
			has_slave_qualification: [10049],

			// 银橙渠道
			yincheng: [10106]
		},

		// 高级条件过滤固定类型报表
		filter_type_list: [
			{
				"Name":_T("")
				,"value":"channel_source"
				,"sub":[
					,{"Name":_T(""),"value":""}
				]
			}
		],

		video_type: video_type,
		// 上传组件配置
		uploader: {
			// 落地页素材
			whisky: {
				url : '/api/dsp/upload?type=whisky',									// 服务器端的上传页面地址
				filters: {
					mime_types : [
						{ title : "RAR压缩文件", extensions : "zip,rar" }	// 只允许上传zip,rar压缩文件
					],
					max_file_size : '5mb'									// 最大上传5MB大小
					// prevent_duplicates : true								// 不允许队列中存在重复文件
				},
				multi_selection: false,										// 单选上传
				tips: _T('请上传：zip,rar文件。文件尺寸小于5MB。')
			},
			// 创意素材
			creative: {
				url : '/api/dsp/upload?type=sweetyCreative',
				filters: {
					mime_types : [ //只允许上传图片文件和rar压缩文件
						{ title : "图片文件", extensions : "jpg,jpeg,gif,png" },
						{ title : "Flash文件", extensions : "swf,flv" },
						{ title : "视频文件", extensions : video_type }
					],
					max_file_size : '20mb'								// 视频素材最大为20mb，其他最大只能上传100kb的文件
					// prevent_duplicates : true								// 不允许队列中存在重复文件
				},
				tips: _T('请上传：jpg,jpeg,png,gif, swf,flv文件。图片文件尺寸小于100kb。视频文件尺寸小于10M。可批量上传，每个尺寸只能上传一个！')
			},
			// 优酷创意素材
			youkuCreative: {
				url : '/api/dsp/upload?type=youku',
				filters: {
					mime_types : [ //只允许上传Flv
						{ title : "视频文件", extensions : video_type }
					],
					multi_selection: false,										// 单选上传
					max_file_size : '20mb'								// 最大只能上传100kb的文件
					// prevent_duplicates : true								// 不允许队列中存在重复文件
				},
				tips: _T('请上传：视频格式文件！')
			},
			// 上传封面
			cover: {
				url : '/api/dsp/upload?type=cover',
				filters: {
					mime_types : [
						{ title : "图片文件", extensions : "jpg,gif,png" }
					],
					max_file_size : '1mb'
				},
				tips: _T('上传封面以便管理，请上传：jpg,png,gif文件。文件尺寸小于1MB。'),
				subModule: 'modules/upload.cover',
				hasProgress: false,
				multi_selection: false
			},
			// 发票信息上传营业执照 财务登记 开户证明一般纳税人
			invoice: {
				url : '/api/dsp/upload?type=invoice',
				filters: {
					mime_types : [
						{ title : "图片文件", extensions : "jpg,gif,png,jpeg" }
					],
					max_file_size : '1mb'
				},
				tips: _T('请上传：jpg,png,jpeg,gif文件。文件尺寸小于1MB。'),
				subModule: 'modules/upload.cover',
				multi_selection: false
			},
			// 资质证件传图
			certificate: {
				url : '/api/dsp/upload?type=certificate',
				filters: {
					mime_types : [
						{ title : "图片文件", extensions : "jpg,gif,png,jpeg" }
					],
					max_file_size : '1mb'
				},
				tips: _T('请上传：jpg,png,jpeg,gif文件。文件尺寸小于1MB。'),
				subModule: 'modules/upload.certificatie',
				multi_selection: false
			},
			// 资质证件传图
			certificate_zip: {
				url : '/api/dsp/upload?type=certificateZip',
				filters: {
					mime_types : [
						{ title : "压缩文件", extensions : "zip" }
					],
					max_file_size : '3mb'
				},
				tips: _T('请上传：zip文件。文件尺寸小于3MB。'),
				subModule: 'modules/upload.certificatie',
				multi_selection: false
			},
			logo: {
				url : '/api/dsp/upload?type=logo',
				filters: {
					mime_types : [
						{ title : "图片文件", extensions : "jpg,png" }
					],
					max_file_size : '100kb'
				},
				tips: _T('图片格式要求：80*80 png/jpg'),
				subModule: 'modules/upload.cover',
				hasProgress: false,
				multi_selection: false
			},
			// 财务申请附件图片
			financeAudit: {
				url : '/api/dsp/upload?type=financeAudit',
				filters: {
					mime_types : [
						{ title : "图片文件", extensions : "jpg,gif,png,jpeg" }
					],
					max_file_size : '1mb'
				},
				tips: _T('请上传：jpg,png,jpeg,gif文件。文件尺寸小于1MB。'),
				subModule: 'modules/upload.cover',
				multi_selection: false
			}
		},

		// 素材预览地址
		materialPreview: {
			'whisky': '/api/dsp/preview/whisky/{id}/',
			'sweety': '/api/dsp/preview/sweety/{id}',
			'sweetyCreative': '/api/dsp/preview/sweetyCreative/{id}/',
			'picTextVideo': '/api/dsp/preview/picTextVideo/{id}/',
			'admCreative': '/api/dsp/preview/sweetyCreative?u={url}',	// 自定义物料
			'product': '#product/edit/{id}'
		},

		// 资质证件类型列表
		certificateList: require('@static/certificateList'),
		// 资质证件补充信息
		certificateExtra: [
			{
				"field": "CrtId",
				"title": "文件编号",
				"type": "text"
			},
			{
				"field": "CrtBeginDate",
				"title": "开始时间",
				"type": "date"
			},
			{
				"field": "CrtEndDate",
				"title": "结束时间",
				"type": "date"
			}
		],
		// 以下证件需要检查是否填写补充信息。
		validateCrtExtra: [
			1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,
			1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,
			1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,
			1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,
			1244,1245,1246,1015,1014,1025,1008,1007,1005,1004,1054,
			1098,1051,1091,1058
		],

		//客户端设置
		client: {
			os:[
				{
					'text':_T('Windows'),
					'list': {
						10015:'Win7',
						10018:'WinVista',
						10019:'WinXP',
						10054:'Win8',
						10065:'Win10'
					}
				},
				{
					'text':_T('Unix'),
					'list': {
						10028:'MacOSX',
						10050:'Ubuntu',
						10051:'CentOS',
						10052:'Debian',
						10053:'RedHat'
					}
				},
				{
					'text':_T('Android'),
					'list': {
						10006:'Android'
					}
				},
				{
					'text':_T('iOS'),
					'list': {
						10026:'i-Pad',
						10027:'i-Phone'
					}
				}
			],
			browser:[
				{
					'text':_T('主流'),
					'list': {
						10019: 'IE',
						10156: '360安全',
						11556: '360极速',
						10004: 'Chrome',
						10050: 'Safari',
						10013: 'Firefox',
						15356: 'QQBrowser',
						10036: 'Maxthon',
						15256: '搜狗',
						10236: '猎豹',
						10136: '2345'
					}
				},
				{
					'text':_T('非主流'),
					'list': {
						10856: 'BaiduBrowser',
						10003: 'BlackBerry',
						12356: 'Firebird',
						14556: 'Myie',
						10039: 'Mozilla',
						15056: 'Netscape',
						10042: 'Opera',
						15456: 'UCWEB',
						15656: 'webOS',
						15856: 'TT',
						15756: 'WebPro',
						15956: 'TheWorld'
					}
				}
			],
			campaignLang: [
				{
					text: _T('使用人口较多的语种，暂只支持谷歌、谷歌移动渠道'),
					list: [
						{id: 10219, name: _T('中文')}
						,{id: 10220, name: _T('中文(简体)')}
						,{id: 10221, name: _T('中文(香港)')}
						,{id: 10222, name: _T('中文(澳门)')}
						,{id: 10223, name: _T('中文(新加坡)')}
						,{id: 10224, name: _T('中文(繁体)')}
						,{id: 10045, name: _T('英语')}
						,{id: 10060, name: _T('西班牙语')}
						,{id: 10003, name: _T('阿拉伯语')}
						,{id: 10103, name: _T('印地语')}
						,{id: 10162, name: _T('葡萄牙语')}
						,{id: 10171, name: _T('俄语')}
						,{id: 10119, name: _T('日语')}
						,{id: 10035, name: _T('德语')}
					]
				}
			],
			language:{
				10000:'简体中文',
				10001:'繁体中文(台湾)',
				10002:'丹麦语',
				10003:'西班牙语(美国)',
				10004:'朝鲜语',
				10005:'英语(美国)',
				10006:'瑞典语',
				10007:'挪威语',
				10008:'德语',
				10009:'日语',
				10010:'葡萄牙语',
				10011:'西班牙语',
				10012:'法语',
				10013:'荷兰语',
				10014:'意大利语',
				10015:'繁体中文(香港)',
				10016:'中文',
				10017:'英语(英国)',
				10018:'英语(爱尔兰)',
				10019:'英语(澳大利亚)',
				10020:'英语(伯利兹)',
				10021:'英语(菲律宾)',
				10022:'英语(南非)',
				10023:'英语(新西兰)'
			}
		},

		// 移动端客户端设置
		mobileClient: {
			// 设备类型
			'device': {
				0: _T('手机'),
				1: _T('平板'),
				3: _T('电视')
			},
			// 操作系统
			'os': {
				20028: _T('IOS'),
				10006: _T('Android')
			},
			//品牌
			'brand':{
				'Huawei':'华为'
				,'vivo':'vivo'
				,'samsung':'三星'
				,'Xiaomi':'小米'
				,'apple':'苹果'
			},
			//上网类型
			'net': {
				1:'Wifi'
				,2:'2G'
				,3:'3G'
				,4:'4G'
			},
			'deviceType':[
				{
					'text':_T('华为'),
					'list': {
						'HUAWEI G750-T01':'荣耀3X'
					}
				},
				{
					'text':_T('vivo'),
					'list': {
						'vivo X5L':'vivo X5',
						'vivo X3t':'vivo X3t'
					}
				},
				{
					'text':_T('三星'),
					'list': {
						'SM-N9005':'Glaxy Note3',
						'GT-I9300':'Glaxy S3',
						'GT-N7100':'Glaxy Note2'
					}
				},
				{
					'text':_T('小米'),
					'list': {
						'hongmi':'红米',
						'hongmi 1s':'红米1s',
						'hongmi note 1':'红米note1',
						'mi 1s':'小米1s',
						'mi 2s':'小米2s',
						'mi 3':'小米3',
						'mi 4':'小米4'
					}
				},
				{
					'text':_T('苹果'),
					'list': {
						'iphone 2g':'iphone 2g',
						'iphone 3g':'iphone 3g',
						'iphone 3gs':'iphone 3gs',
						'iphone 4':'iphone 4',
						'iphone 4s':'iphone 4s',
						'iphone 5':'iphone 5',
						'iphone 5c':'iphone 5c',
						'iphone 5s':'iphone 5s',
						'iphone 6 plus':'iphone 6 plus',
						'iphone 6':'iphone 6',
						'ipad 1g':'ipad 1g',
						'ipad 2':'ipad 2',
						'ipad mini 1g':'ipad mini 1g',
						'ipad 3':'ipad 3',
						'ipad 4':'ipad 4',
						'ipad air':'ipad air',
						'ipad mini 2':'ipad mini 2',
						'ipad mini 3':'ipad air 2'
					}
				}
			],
			'carriers': {
				1: _T('中国移动'),
				2: _T('中国电信'),
				3: _T('中国联通'),
				4: _T('中国铁通')
			}
		},

		// 湿度
		humidity: {
			1: _T('干燥（0% ~ 40%）'),
			2: _T('舒适（40% ~ 70%）'),
			3: _T('潮湿（70% ~ 100%）')
		},

		// 空气指数
		AQI: {
			1: _T('优（0 ~ 50）'),
			2: _T('良（51 ~ 100）'),
			3: _T('轻度污染（101 ~ 150）'),
			4: _T('中度污染（151 ~ 200）'),
			5: _T('重度污染（201 ~ 300）'),
			6: _T('严重污染（300以上）')
		},
		// 旧
		smartMonitorIndex: [
			{Name: _T('成本'), _id: 'group', Unit: '', group: true},
			{Name: _T('总消费'), _id: 'cost', Unit: _T('元')},
			{Name: _T('CPM'), _id: 'cpm', Unit: _T('元')},
			{Name: _T('CPA'), _id: 'cpa', Unit: _T('元')},
			{Name: _T('CPC'), _id: 'cpc', Unit: _T('元')},
			{Name: _T('到达单价'), _id: 'back_reach_cost', Unit: _T('元')},
			{Name: _T('前端'), _id: 'group', Unit: '', group: true},
			{Name: _T('展示量'), _id: 'impressions', Unit: _T('次')},
			{Name: _T('点击量'), _id: 'clicks', Unit: _T('次')},
			{Name: _T('点击率'), _id: 'click_rate', Unit: _T('%'), NeedTrans: true},
			{Name: _T('点击到达率'), _id: 'click_reach_rate', Unit: _T('%'), NeedTrans: true},
			{Name: _T('转化'), _id: 'group', Unit: '', group: true},
			{Name: _T('注册率'), _id: 'back_reg_rate', Unit: _T('%'), NeedTrans: true},
			{Name: _T('竞价'), _id: 'group', Unit: '', group: true},
			{Name: _T('出价数'), _id: 'bid_num', Unit: _T('元')},
			{Name: _T('竞得率'), _id: 'win_rate', Unit: _T('%'), NeedTrans: true}
		],
		// 新-监控指标
		smartMonitorMetric: {
			// 活动
			'1': [
				{Name: _T('成本'), _id: 'group', Unit: '', group: true},
				{Name: _T('总消费'), _id: 'cost', Unit: _T('元')},
				{Name: _T('CPM'), _id: 'cpm', Unit: _T('元')},
				{Name: _T('CPA'), _id: 'cpa', Unit: _T('元')},
				{Name: _T('CPC'), _id: 'cpc', Unit: _T('元')},
				{Name: _T('到达单价'), _id: 'back_reach_cost', Unit: _T('元')},

				{Name: _T('前端'), _id: 'group', Unit: '', group: true},
				{Name: _T('展示量'), _id: 'impressions', Unit: _T('次')},
				{Name: _T('点击量'), _id: 'clicks', Unit: _T('次')},
				{Name: _T('点击率'), _id: 'click_rate', Unit: _T('%'), NeedTrans: true},
				{Name: _T('点击到达率'), _id: 'click_reach_rate', Unit: _T('%'), NeedTrans: true},

				{Name: _T('转化'), _id: 'group', Unit: '', group: true},
				{Name: _T('注册率'), _id: 'back_reg_rate', Unit: _T('%'), NeedTrans: true},

				{Name: _T('竞价'), _id: 'group', Unit: '', group: true},
				{Name: _T('出价数'), _id: 'bid_num', Unit: _T('元')},
				{Name: _T('竞得率'), _id: 'win_rate', Unit: _T('%'), NeedTrans: true}
			],
			// 广告位
			'2': [
				{Name: _T('成本'), _id: 'group', Unit: '', group: true},
				{Name: _T('总消费'), _id: 'cost', Unit: _T('元')},
				{Name: _T('CPM'), _id: 'cpm', Unit: _T('元')},
				{Name: _T('CPA'), _id: 'cpa', Unit: _T('元')},
				{Name: _T('CPC'), _id: 'cpc', Unit: _T('元')},
				{Name: _T('到达单价'), _id: 'back_reach_cost', Unit: _T('元')},

				{Name: _T('前端'), _id: 'group', Unit: '', group: true},
				{Name: _T('展示量'), _id: 'impressions', Unit: _T('次')},
				{Name: _T('点击量'), _id: 'clicks', Unit: _T('次')},
				{Name: _T('点击率'), _id: 'click_rate', Unit: _T('%'), NeedTrans: true},
				{Name: _T('点击到达率'), _id: 'click_reach_rate', Unit: _T('%'), NeedTrans: true},

				{Name: _T('落地页'), _id: 'group', Unit: '', group: true},
				{Name: _T('B_平均窗口大小'), _id: 'back_avg_pagepixels', Unit: _T('px')},
				{Name: _T('B_平均停留时间'), _id: 'back_avg_staytime', Unit: _T('秒')},

				{Name: _T('转化'), _id: 'group', Unit: '', group: true},
				{Name: _T('注册率'), _id: 'back_reg_rate', Unit: _T('%'), NeedTrans: true},
				{Name: _T('点击注册率'), _id: 'back_reg_click_rate', Unit: _T('%'), NeedTrans: true},

				{Name: _T('竞价'), _id: 'group', Unit: '', group: true},
				{Name: _T('出价数'), _id: 'bid_num', Unit: _T('元')},
				{Name: _T('竞得率'), _id: 'win_rate', Unit: _T('%'), NeedTrans: true}
			]
		},
		smartMonitorOperator: [
			{Name: _T('大于等于'), _id: '>='},
			//{Name: _T('大于'), _id: '>'},
			//{Name: _T('等于'), _id: '='},
			//{Name: _T('小于'), _id: '<'},
			{Name: _T('小于等于'), _id: '<='}
		],

		country:{
			"china":10761
		},

		// 缺省显示指标
		defaultMetrics: [],
		// 全部指标
		allMetrics: [],
		// 拥有指标
		ownMetrics: [],
		// 缺省分组信息
		defaultGroup: null,
		// 列表指标分组配置
		metricsGroup: null,

		PTC: {
			'TYPE': {
				'ADX': 1,
				'TEMPLATE': 2,
				'FIELD': 3
			},
			FIELD_TYPE: {
				TEXT: 1
				,IMAGE: 2
				,HIDDEN: 3 //　文字的变形，不给用户看见，但后端需要设定值。
				,RADIO: 4
				,VIDEO: 5
			}
		},

		'AdTool': {
			'Dimension':
			{
				'campaign_id': _T('活动ID'),
				'package_id':_T('创意包ID'),
				'whisky_id':_T('落地页ID'),
				'qualification_id':_T('资质ID'),
				'creative_id':_T('创意ID'),
				'product_id':_T('产品ID'),
				'adsGroup_id':_T('广告位分组ID'),
				'spot_id':_T('广告位ID')
			}
		},

		getHashConf: function(hash)
		{
			var ret = false;
			util.each([report_menu, admin_menu],function(menu) {
				if(menu && menu.length)
				{
					util.each(menu, function(item) {
						if(item.link && hash.indexOf(item.link) > -1)
						{
							ret = item;
							return false;
						}
						if(item.items && item.items.length)
						{
							util.each(item.items, function(sub)
							{
								if(sub.link && hash.indexOf(sub.link) > -1)
								{
									ret = item;
									return false;
								}
							});

							if(ret)
							{
								return false;
							}
						}
					});

					if(ret)
					{
						return false;
					}
				}
			});

			return ret;
		},

		//登录成功后的回调方法.
		loginCb: function(app, cb) {
			//config 里的配置登录前是没有权限获取的,只能在这里再获取.
			//本想require()的, 但发现应该是cookie没来得及更新,以致再次说要求再登录.但这样就行...
			app.mc.send('user/config', function(err, data) {
				if(err)
				{
					app.mc.send('error/log', {message: err.message + ", 请联系开发人员", type: 'front'});
					win.location.reload();
					return false;
				}

				if(data)
				{
					if(data.exchange) {
						var exchange = data.exchange;
						app.config('allExchange', exchange.allExchange);
						app.config('exchange', exchange.list);
						app.config('pcChannel', exchange.pc);
						app.config('mobileChannel', exchange.mobile);
						app.config('channelMap', exchange.map);
						app.config('aptitude_group', exchange.aptitude_group);
						app.config('aptitude_change_industry', exchange.aptitude_change_industry);
						app.config('exchange_group/bdx_media_class', exchange.bdx_media_group);
						app.config('exchange_group/ad_class', exchange.needAdCategory);
						app.config('exchange_group/campaign_industry', exchange.campaign_industry);
						app.config('exchange_group/needCrtExtra', exchange.needCrtExtra);

						app.config('exchange_group/sens_class', exchange.needAdSensitive);
						app.config('exchange_group/campaign_sensitive', exchange.campaign_sensitive);
						app.config('deal_need_set_spot', exchange.dealSetSpot);
						app.config('adx_has_pageChannel', exchange.has_pageChannel);
					}
					if(data.labels) {
						var labels = require('@sys_labels');
						if(labels) {
							labels = labels.labels;
							$.extend(labels.config, data.labels);
						}
					}
					if(data.metrics) {
						var metrics = data.metrics;
						app.config('defaultMetrics', metrics.defaultMetrics);
						app.config('defaultGroup', metrics.defaultGroups);
						app.config('metricsGroup', metrics.grids);
					}
					if(data.allMetrics) {
						app.config('allMetrics', data.allMetrics);
					}
					if(data.ownMetrics) {
						app.config('ownMetrics', data.ownMetrics);
					}
				}

				// 过滤没有权限的菜单。
				var t;
				var t_menu = util.clone([report_menu, admin_menu]);
				dspUtil.filterMenu(t_menu, app);
				var switch_items = [];
				if(t_menu[0].length)
				{
					switch_items.push({text:_T('数据报表'),alias:_T('报表'), link:'#', 'class':'list', def: true, icon: 'icon-manage'});
				}
				if(t_menu[1].length)
				{
					// 取出所拥有的后台全部菜单项，设置第一个为默认
					var lists = [];
					util.each(t_menu[1], function(item){
						if(item && item.items && item.items.length){
							util.each(item.items, function(list){
								if(list){
									lists.push(list);
								}
							});
						}
					});
					switch_items.push({text:_T('管理后台'),alias:_T('后台'), link: lists[0] && lists[0].link, 'class':'admin', icon:'icon-report'});
				}

				t = app.core.get('SYS_PLATFORM/switch');
				if(t)
				{
					if(switch_items.length < 2) {
						// 如只有一个菜单栏，就隐藏
						t.hide();
					}
					else {
						// 这里构建切换模块。
						t.buildContent(switch_items);
					}
				}

				t = app.core.get('SYS_PLATFORM/menu');
				if(t)
				{
					// 这里构建菜单模块。
					t.buildMenu(t_menu);
				}

				t = app.core.get('SYS_PLATFORM/header/switchProduct');
				if(t)
				{
					// 构建可切换产品模块
					t.buildSwitchProduct();
				}

				if(cb)
				{
					cb();
				}
			});
		},
		grid: {
			// 排序的字段名命名,缺省叫"sort",此项目中使用"order"命名
			sortName: 'order'
		},
		history_id: '_DSP_HISTORY_UID'
	};
});